/*
 * @Description: 
 * @Version: 
 * @Autor: LiChuang
 * @Date: 2024-05-22 16:20:04
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-05-23 18:22:24
 */
// background.js
chrome.runtime.onMessage.addListener((message, sender, sendResponse)=> {
	if (message.action === 'sendData') {
	  // 存储数据到 Chrome 扩展的本地存储中
	  chrome.storage.local.set({ dataList: message.data }, ()=>{
		console.log('Data stored in background.js');
	  });
	}
	if (message.action === 'downloadImage') {
        chrome.downloads.download({ url: message.url });
    }
  });
  chrome.tabs.query({ active: true, lastFocusedWindow: true }).then((result) => {
	console.log(result,2222)
  }).catch((err) => {
	
  });